package com.sky.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import com.sky.domain.BaseEntity;
import com.sky.entity.SetmealDish;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@SearchBean(tables = " setmeal s left join category c on s.category_id = c.id and c.del_flag = '0' ",
        where = "s.del_flag = '0'",autoMapTo = "s")
public class SetmealVO extends BaseEntity {

    @DbField("s.id")
    private Long id;

    //分类id
    @DbField("s.category_id")
    private Long categoryId;

    //套餐名称
    @DbField("s.name")
    private String name;

    //套餐价格
    @DbField("s.price")
    private BigDecimal price;

    //状态 0:启用 1:停用
    @DbField("s.status")
    private Integer status;

    //描述信息
    @DbField("s.description")
    private String description;

    //图片
    @DbField("s.image")
    private String image;

    //分类名称
    @DbField("c.name")
    @TableField(exist = false)
    private String categoryName;

    //套餐和菜品的关联关系
    @DbIgnore
    @TableField(exist = false)
    private List<SetmealDish> setmealDishes = new ArrayList<>();
}
